package com.xm.service.background;

import com.xm.dao.background.LogisticsCompaniesDao;
import com.xm.entity.LogisticsCompanies;
import com.xm.exception.SqlErrorException;

import java.util.List;

/**
 * @author 康文程
 * @date 2024-1-11
 */
public class LogisticsCompaniesService {
    private final LogisticsCompaniesDao dao = new LogisticsCompaniesDao();
    /**
     * 查询全部物流公司
     *
     * @return 物流公司列表
     * @throws SqlErrorException SQL异常
     */
    public List<LogisticsCompanies> getAllLogisticsCompanies() throws SqlErrorException {
        return dao.getAllLogisticsCompanies();
    }
    /**
     * 根据物流公司ID更新物流公司信息
     *
     * @param logisticsCompanies 更新后的物流公司信息
     * @throws SqlErrorException SQL异常
     */
    public void updateLogisticsCompaniesById( LogisticsCompanies logisticsCompanies) throws SqlErrorException {
        dao.updateLogisticsCompaniesById( logisticsCompanies);
    }
    /**
     * 新增物流公司
     *
     * @param logisticsCompanies 要新增的物流公司信息
     * @throws SqlErrorException SQL异常
     */
    public void addLogisticsCompanies(LogisticsCompanies logisticsCompanies) throws SqlErrorException {
        dao.addLogisticsCompanies(logisticsCompanies);
    }
}
